package dimension.starry.gui.Bar;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.network.ClientPlayerEntity;

/**
 * @author 150149
 */
@Environment(EnvType.CLIENT)
public class UID {

    public static void onHudRender(DrawContext drawContext, float tickDelta) {
        ClientPlayerEntity player = MinecraftClient.getInstance().player;
        if (player == null) {
            return;
        }

        TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
        drawContext.drawCenteredTextWithShadow(textRenderer, "UID: " + player.getName().getString(), 30,
            MinecraftClient.getInstance().getWindow().getScaledHeight() - 15, 16777215
        );
    }

}
